﻿using System;
using System.Collections.Generic;
using System.Text;
using BCMS.Business.DataContract;

namespace BCMS.DAL.IDAL
{
    public interface IRelease
    {
        void BeginADOTransaction();
        void RollBackTransaction();
        void CommitADOTransaction();
        void Open(string connString);
        void Close();

        int insertRelease(string name, DateTime start, DateTime expire, long qtty, decimal parvalue, int target, string detail, string note, int kind, string rcode, long rlow, long rhigh);

        List<ReleaseInfo> getReleaseByDate(DateTime from, DateTime to);

        ReleaseInfo getReleaseById(int releaseId);

        List<string> getDetailSuggest();

        List<ReleaseInfo> getReleases();

        List<ReleaseInfo> searchRelease(string code, long num, long parValue, int kind, int target, string detail, DateTime from, DateTime to);
        
        void updateReleaseNote(int releaseId, string note);

        void updateReleaseById(int releaseId, string name, DateTime start, DateTime expire, long qtty, decimal parvalue, int target, string detail, string note, int kind, string rcode, long rlow, long rhigh);

        int updateReleaseStatusById(int releaseId, int newStatus, string note);

        void updateReleaseQttyByName(long qtty, string name);

        void deleteRelease(int releaseId);

        ReleaseInfo getReleaseByName(string name);
    }
}
